package cn.life.common.utils;

import java.io.File;
import java.io.FileOutputStream;
import java.util.Date;

/**
 * @Description:
 * @Author 李佳明
 * @Date 2018/7/27 0027.22:47.
 */
public class FileUploadUtil {

    public static String uploadFile(byte[] file, String filePath, String fileName) throws Exception {
        String path = filePath + fileName;
        File targetFile = new File(filePath);
        if(!targetFile.exists()){
            targetFile.mkdirs();
        }
        FileOutputStream out = new FileOutputStream(path);
        out.write(file);
        out.flush();
        out.close();
        return fileName;
    }

}
